<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>
        user: <input type="text" name="" id="user">
    </p>
    <p>
        password: <input type="text" name="" id="password">
    </p>
    <p>
        <button id="login">登录</button>
        <button id="zc">注册</button>
    </p>
</body>
    <script src="./axios.js"></script>
    <script>
        const user = document.getElementById("user");
        const password = document.getElementById("password");
        const login = document.getElementById("login");
        const zc = document.getElementById("zc");

        login.onclick = ()=>{
            axios.post("/login",{
                user:user.value,
                password:password.value
            }).then((res) => {
                console.log(res)
            })
        }

        zc.onclick = ()=>{
            axios.post("zc",{
                user:user.value,
                password:password.value
            }).then((res) => {
                console.log(res)
            })
        }
    </script>
</html>